<?php
global_config::get_instance()->add_server_class("SoapClusterizationResult","soap_clusterization_result");
class soap_clusterization_result
{
		/**
		 * Clusters
		 *
		 * @var soap_array_of_soap_cluster
		 */
        public $Clusters =array();
        
        /**
         * Quality
         *
         * @var int
         */
        public $Quality;
        
        
        public function save_to_db()
        {
        	$clusterisation_result = new clusterisation_result();
        	$clusterisation_result->clusterisation_id->set_value($this->clusterisation_id);
        	$clusterisation_result->count->set_value(count($this->Clusters->as_array()));
        	$clusterisation_result->quality->set_value($this->Quality);
        	
        	$dba = db_adapter::get_instance();
        	$dba->save_unique($clusterisation_result);
        	$clusterisation_result_id =$clusterisation_result->clusterisation_result_id->get_value();
        	
        	$this->Clusters->save_to_db($clusterisation_result_id);
        }
}
?>